package stringBuilder;
/**
 *
 * */
public class MatchsDemo {
    public static void main(String[] args) {
        String regex="[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";
        String regex1="\\w+@\\w+(\\.[a-zA-Z]+)+";

        String name="123@qq.com";
        if(name.matches(regex1)){
            System.out.println("name匹配成功");
        }else{
            System.out.println("name匹配失败");
        }
        if(name.matches(regex)){
            System.out.println("name匹配成功");
        }else{
            System.out.println("name匹配失败");
        }
    }
}
